package com.qywx.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qywx.entity.DepartmentEntity;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * @ClassName DepartmentDao
 * @Description: TODO
 * @Author wmj
 * @Date 2020/3/2
 * @Version V1.0
 **/
@Component
@Mapper
public interface DepartmentDao extends BaseMapper<DepartmentEntity> {

    List<DepartmentEntity> findByName(String name);

    List<DepartmentEntity> getDepartmentList();

    DepartmentEntity findByNameAndParentid(String name, Long parentid);

    DepartmentEntity selectByParentid(Long parentid);

    String asynchronousDetection();

    List<DepartmentEntity> synchronize();

    String findNameById(String department);

    List<DepartmentEntity> findByNameAll(String name);

    int save(DepartmentEntity department);

    List<DepartmentEntity> findChildren(Long id);

    void backups(DepartmentEntity departmentEntity);

    DepartmentEntity selById(int id);

    void delByDepIdAndUserid(String userid, Long depid);

    List<Integer> selByUserid(String userid);

    List<Integer> findChildDepId(Integer id);

}
